package com.wxxymakers.grademark.model.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wxxymakers.grademark.model.entity.WxItemRecord;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface WxItemRecordMapper extends BaseMapper<WxItemRecord> {

    /**
     * 分页查询 可以根据部门id进行查询
     * @param deptId 部门id
     */
    List<WxItemRecord> page(@Param("offset") Integer offset, @Param("limit") Integer limit,
                            @Param("collegeId") Integer collegeId, @Param("deptId") Integer deptId,
                            @Param("username") String username,
                            @Param("record") WxItemRecord record);

    long pageCount(@Param("collegeId") Integer collegeId, @Param("deptId") Integer deptId,
                   @Param("username") String username,
                   @Param("record") WxItemRecord record);

    /**
     * 统计事件参与人数
     * @param iid 事件id
     */
    long countPeople(@Param("iid") int iid);

    long countPeopleTwo(@Param("iid") int iid, @Param("collegeId") Integer collegeId);

    @Update("update wx_item_record set status = #{status} where id = #{rid}")
    int updateStatus(@Param("rid") int rid, @Param("status") String status);
}